package game.gfx;

import game.Game;
import game.entities.Player;
import game.level.Level;

public class Screen
{
	Level level;
	Player player;
	
	int xPos;
	int yPos;
	
	int levelWidth;
	int levelHeight;
	
	int width;
	int height;
		
	public Screen(Level level, int width, int height)
	{
		this.level = level;
		this.width = width;
		this.height = height;
	}
	
	public void renderLevel()
	{
		int levelHeight = level.getHeight() * 8;
		int levelWidth = level.getWidth() * 8;
		
		int index = 0;

		int[][] pixelData = level.getLevelPixels();
//		System.out.println(Game.pixels.length);
		
		for (int y = 0; y < levelHeight; y++)
		{
			for (int x = 0; x < levelWidth; x++)
			{
		//		if(index >= Game.pixels.length) break;
				Game.pixels[index] = pixelData[x][y];
				index++;
			}
		}
		

	
//		for (int y = 0; y < height; y++)
//		{
//			for (int x = 0; x < width; x++)
//			{
//				for (int i = 0; i < 8; i++)
//				{
//					if(index >= Game.pixels.length) break;
//					Game.pixels[index] = pixelData[x][y];
//					index++;
//				}
//			}
//		}
	}
}
